package easy;

public class Solution_342 {
    public static boolean isPowerOfFour(int n) {
        if (n==1) {
            return true;
        }
        while (true) {
            if (n<4 || n%4!=0) {
                return false;
            }
            n /= 4;
            if (n==1) {
                return true;
            }
        }
    }

    public static void main(String[] args) {
        System.out.println(isPowerOfFour(5));
    }
}
